package com.aqumon.www.entity.persistent;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * jenkins job 列表
 * </p>
 *
 * @author aqumon
 * @since 2022-05-19
 */
@Data
@TableName("script")
@ApiModel(value = "Script对象", description = "jenkins job 列表")
public class Script implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty("jenkins job 全名")
    @TableField("job_full_name")
    private String jobFullName;

    @ApiModelProperty("脚本名称")
    @TableField("script_name")
    private String scriptName;

    @ApiModelProperty("最后执行状态")
    @TableField("last_build_status")
    private String lastBuildStatus;

    @ApiModelProperty("最后执行时间")
    @TableField("last_build_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
    private Date lastBuildTime;

    @ApiModelProperty("代码仓库地址")
    @TableField("code_repository")
    private String codeRepository;

    @ApiModelProperty("jenkins配置表的jenkins_id")
    @TableField("jenkins_id")
    private Long jenkinsId;

    @ApiModelProperty("脚本描述")
    @TableField("description")
    private String description;

    @ApiModelProperty("所属项目/产品")
    @TableField("product")
    private String product;

    @ApiModelProperty("所属功能模块")
    @TableField("module")
    private String module;

    @ApiModelProperty("'记录创建时间'")
    @TableField("gmt_created")
    private Date gmtCreated;

    @ApiModelProperty("'记录修改时间")
    @TableField("gmt_modified")
    private Date gmtModified;

    public Script(Long id) {
        this.id = id;
    }

}
